/**
 * 装饰器
 */
class Circle {
    draw() {
       console.log("Shape: Circle");
    }
}

//装饰器
class RedBorderDecorator{
    constructor(obj){
        this.obj = obj
    }
    draw(){
        this.setBorder()
        this.obj.draw()
    }
    setBorder(){
        console.log('a red border')
    }
}

let circle = new Circle()
circle.draw()
console.log('---------')
let circleDecorated = new RedBorderDecorator(circle)
circleDecorated.draw()